package com.ruoyi.sales.mapper;

import com.ruoyi.common.core.domain.entity.ZcStock;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ZcStockMapper {
    List<ZcStock> selectStockList(ZcStock stock);

    ZcStock selectStockById(Long stockId);

    ZcStock checkStockNameUnique(@Param("stockName") String stockName,@Param("parentId") Long parentId);

    int insertStock(ZcStock stock);

    int selectNormalChildrenStockById(Long stockId);

    //根据ID查询所有子部门
    List<ZcStock> selectChildrenStockById(Long stockId);

    //修改子元素关系
    int updateStockChildren(@Param("stocks") List<ZcStock> stocks);

    //修改信息
    int updateStock(ZcStock stock);

    //修改产品正常状态
    void updateStockStatusNormal(Long[] stockIds);

    int hasChildByStockId(Long stockId);

    int deleteStockById(Long stockId);

    int updateStockStatus(ZcStock stock);
}
